package com.wxj.shopping_mall.service.impl;

import com.wxj.shopping_mall.entity.Wallet;
import com.wxj.shopping_mall.mapper.WalletMapper;
import com.wxj.shopping_mall.service.WalletService;
import org.omg.CORBA.INTERNAL;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class WalletServiceImpl implements WalletService {

    @Autowired
    private WalletMapper walletMapper;

    @Override
    public Wallet queryWallet(Integer userId) {
        return walletMapper.queryWaller(userId);
    }

    @Override
    public int openWallet(Integer userId, int status) {
        return walletMapper.openWallet(userId, status);
    }

    @Override
    public int updateWalletStatus(Integer userId, int status) {
        Date updateDate = new Date();
        return walletMapper.updateWalletStatus(userId, status, updateDate);
    }

}
